/*
 * tasks.h
 *
 *  Created on: 29-06-2012
 *      Author: Mati
 */

#ifndef TASKS_H_
#define TASKS_H_

#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif
#include "FreeRTOS.h"
#include "queue.h"
#include "semphr.h"
#include "portmacro.h"
#include "semphr.h"
#include "timers.h"
#include "../LED/LED.h"
#include "../ADC/ADC.h"
#include "../UART/UART.h"
#include "../EEPROM/eeprom.h"
#include "../Protocol/Protocol.h"
#include "../Preconcentrator/prec.h"
#include "../ETCO2/etco2.h"
#include "../GPDMA/GPDMA.h"

#define NUM_OF_ADC_SAMPLES 500
#define NaN 0x7fc00000


extern xSemaphoreHandle xAdc2UartSem;
extern xQueueHandle xSpeakerParamQueue;

enum Mode { PREPARE, WORK };
enum PrepareState { STAGE1, STAGE2, STAGE3, STAGE4, STAGE5 };
enum WorkState { ADSORPTION, DESORPTION };
enum Process { HEATING, COOLING };

extern enum Mode eCurrentMode;
extern enum PrepareState epState;
extern enum WorkState ewState;
extern enum Process eProcess;

void vReceiveValuesTask(void *pvParameters);

void vSpeakerTask(void *pvParameters);

void vFeedbackTask(void *pvParameters);

void vTimerCallback( xTimerHandle pxTimer );

void vETCO2Task(void *pvParameters);

#endif /* TASKS_H_ */
